/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.project.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Malek
 */
@Entity
@Table(name = "COMMANDECLIENT", catalog = "", schema = "ONECOMMERCE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Commandeclient.findAll", query = "SELECT c FROM Commandeclient c"),
    @NamedQuery(name = "Commandeclient.findByIdreservation", query = "SELECT c FROM Commandeclient c WHERE c.idreservation = :idreservation"),
    @NamedQuery(name = "Commandeclient.findByQuantite", query = "SELECT c FROM Commandeclient c WHERE c.quantite = :quantite"),
    @NamedQuery(name = "Commandeclient.findByDateReser", query = "SELECT c FROM Commandeclient c WHERE c.dateReser = :dateReser"),
    @NamedQuery(name = "Commandeclient.findByStatusreser", query = "SELECT c FROM Commandeclient c WHERE c.statusreser = :statusreser"),
    @NamedQuery(name = "Commandeclient.findByStatus", query = "SELECT c FROM Commandeclient c WHERE c.status = :status")})
public class Commandeclient implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDRESERVATION", nullable = false, precision = 22, scale = 0)
    private BigDecimal idreservation;
    @Basic(optional = false)
    @NotNull
    @Column(name = "QUANTITE", nullable = false)
    private BigInteger quantite;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DATE_RESER", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date dateReser;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "STATUSRESER", nullable = false, length = 50)
    private String statusreser;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "STATUS", nullable = false, length = 50)
    private String status;
    @JoinColumn(name = "IDINSCRIT", referencedColumnName = "IDINSCRIT", nullable = false)
    @ManyToOne(optional = false)
    private Prospect idinscrit;
    @JoinColumn(name = "IDITEM", referencedColumnName = "IDITEM", nullable = false)
    @ManyToOne(optional = false)
    private Item iditem;

    public Commandeclient() {
    }

    public Commandeclient(BigDecimal idreservation) {
        this.idreservation = idreservation;
    }

    public Commandeclient(BigDecimal idreservation, BigInteger quantite, Date dateReser, String statusreser, String status) {
        this.idreservation = idreservation;
        this.quantite = quantite;
        this.dateReser = dateReser;
        this.statusreser = statusreser;
        this.status = status;
    }

    public BigDecimal getIdreservation() {
        return idreservation;
    }

    public void setIdreservation(BigDecimal idreservation) {
        this.idreservation = idreservation;
    }

    public BigInteger getQuantite() {
        return quantite;
    }

    public void setQuantite(BigInteger quantite) {
        this.quantite = quantite;
    }

    public Date getDateReser() {
        return dateReser;
    }

    public void setDateReser(Date dateReser) {
        this.dateReser = dateReser;
    }

    public String getStatusreser() {
        return statusreser;
    }

    public void setStatusreser(String statusreser) {
        this.statusreser = statusreser;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Prospect getIdinscrit() {
        return idinscrit;
    }

    public void setIdinscrit(Prospect idinscrit) {
        this.idinscrit = idinscrit;
    }

    public Item getIditem() {
        return iditem;
    }

    public void setIditem(Item iditem) {
        this.iditem = iditem;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idreservation != null ? idreservation.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Commandeclient)) {
            return false;
        }
        Commandeclient other = (Commandeclient) object;
        if ((this.idreservation == null && other.idreservation != null) || (this.idreservation != null && !this.idreservation.equals(other.idreservation))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.project.entities.Commandeclient[ idreservation=" + idreservation + " ]";
    }
    
}
